﻿using System;
using phudieuhungthinh.BL.Model;
using phudieuhungthinh.BL;
using System.Web.Services;

namespace phudieuhungthinh.Admin
{
    public partial class ArticleItem : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [WebMethod(EnableSession=true)]
        public static void Save(ArticleModel model)
        {
            model.IsPublished = true;
            model.ArticleType = (int)ArticleType.Article;
            var articleImpl= new ArticleImpl();
            articleImpl.SaveArticle(model);
        }

        [WebMethod(EnableSession=true)]
        public static object Get(int id)
        {
            var articleImpl = new ArticleImpl();
            ArticleModel model = articleImpl.GetArticle(id);
            return model;
        }
    }
}